<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1 id="timu">hello world</h1>
    <input id="shuru" type="text" onchange="dianle()">
    <button onclick="dianle()">change</button>
    <script>
        var a = 'hello world';
        // console.log(a);
        // window.alert(a);
       
        function dianle(){
            // get value from input
            var s = document.getElementById("shuru")
            var v =  s.value 
            // set value to h1
            var t = document.getElementById("timu");
            t.innerHTML = v
        }
    </script>
</body>
</html>